/* File SendOpen.c
Code snippet illustrating how to launch an application and send it
an open document Apple event.
by John Montbriand, 1995.
Copyright (C) 1995 by Apple Computer, Inc. All Rights Reserved.*/
#include <Types.h>
#include <QuickDraw.h>
#include <Fonts.h>
#include <Windows.h>
#include <TextEdit.h>
#include <Dialogs.h>
#include <Menus.h>
#include <AppleEvents.h>
#include <StandardFile.h>
#include <Files.h>
#include <Errors.h>
#include <Aliases.h>
/* MapCreatorProcs, when provided as a parameter to LaunchTheDocument,
will be called to allow your app to re-map the creator type for a file
to a different creator type. Your function should either modify *creator
to refer to a preferred application by replacing its value with the
value of the preferred application's creator bytes, or leave *creator
untouched if you want the creator bytes from the document to be used. */
typedef void (*MapCreatorProc)(FSSpec *document, OSType type, OSType
*creator);
/* LaunchTheDocument attempts to open the document with either an
application that is already loaded in memory and running, or by finding
and launching the appropriate application with the document as a
parameter. If no application can be found with the creator bytes found
in the document, fnfErr is returned. Local Volumes are searched before
remote server volumes. Remote server volumes are only searched if
use_remote_apps is true. If the optional creator remapping procedure is
provided (remap != NULL), then it will be called to allow the caller to
re-map the creator bytes to a preferred application for the document's
type.. */